package xendit

import (
	"time"

	"gorm.io/gorm"
)

type VaPaymentNotify struct {
	PaymentId                string     `json:"payment_id"`
	CallbackVirtualAccountId string     `json:"callback_virtual_account_id"`
	OwnerId                  string     `json:"owner_id"`
	ExternalId               string     `json:"external_id"`
	AccountNumber            string     `json:"account_number"`
	BankCode                 string     `json:"bank_code"`
	Amount                   int64      `json:"amount"`
	MerchantCode             string     `json:"merchant_code"`
	Id                       string     `json:"id"`
	TransactionTimestamp     *time.Time `json:"transaction_timestamp"`
	CreateTime               *time.Time `json:"create_time"`
}

func (VaPaymentNotify) TableName() string {
	return "xen_va_payment_notify"
}

func (item *VaPaymentNotify) BeforeCreate(tx *gorm.DB) error {
	var now = time.Now()
	item.CreateTime = &now
	return nil
}
